/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author roycalderon
 */
@Entity
@Table(name = "bookReception")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "BookReception.findAll", query = "SELECT b FROM BookReception b"),
    @NamedQuery(name = "BookReception.findByIdbookReception", query = "SELECT b FROM BookReception b WHERE b.idbookReception = :idbookReception"),
    @NamedQuery(name = "BookReception.findByDate", query = "SELECT b FROM BookReception b WHERE b.date = :date")})
public class BookReception implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idbookReception")
    private Integer idbookReception;
    @Column(name = "date")
    @Temporal(TemporalType.TIMESTAMP)
    private Date date;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "bookReceptionidbookReception", fetch = FetchType.LAZY)
    private List<BookList> bookListList;

    public BookReception() {
    }

    public BookReception(Integer idbookReception) {
        this.idbookReception = idbookReception;
    }

    public Integer getIdbookReception() {
        return idbookReception;
    }

    public void setIdbookReception(Integer idbookReception) {
        this.idbookReception = idbookReception;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    @XmlTransient
    public List<BookList> getBookListList() {
        return bookListList;
    }

    public void setBookListList(List<BookList> bookListList) {
        this.bookListList = bookListList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idbookReception != null ? idbookReception.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof BookReception)) {
            return false;
        }
        BookReception other = (BookReception) object;
        if ((this.idbookReception == null && other.idbookReception != null) || (this.idbookReception != null && !this.idbookReception.equals(other.idbookReception))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.BookReception[ idbookReception=" + idbookReception + " ]";
    }
    
}
